<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="oz137116">gpmt analyze_session</title>
  <body>
    <p>This tool traces busy processes associated with a Greenplum Database session. The information
      collected can be used by VMware Support for root cause analysis on hung sessions.</p>
    <section>
      <title>Usage</title>
      <codeblock><b>gpmt</b> <b>analyze_session</b> [<varname>-session SESSION_ID </varname>] [<varname>-master-dir DIRECTORY</varname>] 
[<varname>-segment-dir DIRECTORY</varname>] </codeblock>
    </section>
    <section>
      <title>Options</title>
      <parml>
        <plentry>
          <pt><varname>-session</varname></pt>
          <pd>Greenplum session ID which is referenced in <codeph>pg_stat_activity</codeph>.</pd>
        </plentry>
        <plentry>
          <pt><varname>-master-dir </varname></pt>
          <pd>Working directory for master process.</pd>
        </plentry>
        <plentry>
          <pt><varname>-segment-dir</varname></pt>
          <pd>Working directory for segment processes.</pd>
        </plentry>
        <plentry>
          <pt><varname>-free-space</varname></pt>
          <pd>Free space threshold which will exit log collection if reached. Default value is
            10%.</pd>
        </plentry>
        <plentry>
          <pt><varname>-a</varname></pt>
          <pd>Answer Yes to all prompts.</pd>
        </plentry>
      </parml>
    </section>
    <section>
      <title>Examples</title>
      <p>Collect process information for a given Greenplum Database session id:</p>
      <codeblock>gpmt analyze_session -session 12345</codeblock>
    </section>
    <p>The tool prompt  gives a high-level list of only the servers that are running busy processes
      and how processes are distributed across the Greenplum hosts. This gives an idea of what hosts
      are busier than others, which might be caused by processing skew or other environmental issue
      with the affected hosts. </p>
    <p>Note: <codeph>lsof, strace, pstack, gcore, gdb</codeph> must be installed on all hosts.
        <codeph>gcore</codeph> will perform a memory dump of the Greenplum process and the size
      could be anywhere from 300MB to several Gigabytes. Isolating which hosts to collect using the
        <codeph>gpmt</codeph>global option  <codeph>-hostfile</codeph> to limit the collection
      size.</p>
  </body>
</topic>
